package com.ia.equalization.logic;

public class ImageEqualize {

	private int image[][];
	private int levels;

	public ImageEqualize() {

	}

	public ImageEqualize(int files, int columns) {
		image = new int[files][columns];
	}

	public ImageEqualize(int files, int columns, int levels) {
		this(files, columns);
		this.levels = levels;
	}

	public ImageEqualize(int image[][], int levels) {
		this.image = image;
		this.levels = levels;
	}

	public int[][] getImage() {
		return image;
	}

	public int getElementValue(int file, int column) {
		return image[file][column];
	}

	public int getElementsCount() {
		return image.length * image[0].length;
	}

	public int getFiles() {
		return image.length;
	}

	public int getColumns() {
		return image[0].length;
	}

	public int getLevel(int f, int c) {
		return image[f][c];
	}

	public int getFrequency(int number) {
		int count = 0;

		for (int i = 0; i < image.length; i++)
			for (int j = 0; j < image[0].length; j++)
				if (number == image[i][j])
					count++;

		return count;
	}

	public void setImage(int[][] image) {
		this.image = image;
	}

	public int getLevels() {
		return levels;
	}

	public void setLevels(int levels) {
		this.levels = levels;
	}
}
